package com.ad_hccm.dao.TreatmentHistory;

import com.ad_hccm.domain.TreatmentHistory.OtherDiseaseOne;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 高血压、糖尿病治疗史Dao
 */
@Mapper
public interface OtherDiseaseOneDao {
    @Insert("insert into other_disease_one value(#{id}, #{isHypertension}, #{hypertensionDiseaseCourse}, #{isDiabetes}, #{diabetesDiseaseCourse}, #{highestBloodPressure})")
    public boolean save(OtherDiseaseOne otherDiseaseOne);

    @Update("update other_disease_one set isHypertension = #{isHypertension}, hypertensionDiseaseCourse = #{hypertensionDiseaseCourse}, isDiabetes = #{isDiabetes}, diabetesDiseaseCourse = #{diabetesDiseaseCourse}, highestBloodPressure = #{highestBloodPressure} where id=#{id}")
    public boolean update(OtherDiseaseOne otherDiseaseOne);

    @Select("select * from other_disease_one where id=#{id}")
    public OtherDiseaseOne getById(String id);

    @Select("select * from other_disease_one")
    public List<OtherDiseaseOne> getAll();
}